import Vue from 'vue'
import VueRouter from 'vue-router'

//后台首页
import Home from '../components/Home';
//商城管理
import Product from '../components/shop/products/Home';  //商品列表
import ProductCreate from '../components/shop/products/Create';  //新增商品
import ProductEdit from '../components/shop/products/Edit';  //编辑商品
import Category from '../components/shop/categories/Home';  //商品分类
import Order from '../components/shop/orders/Home';  //订单列表
import OrderShow from '../components/shop/orders/Show';  //订单详情
import User from '../components/shop/users/Home';  //会员列表
import Account from '../components/shop/accounts/Home';  //账户管理
import Ticket from '../components/shop/tickets/Home';  //优惠券
import TicketCreate from '../components/shop/tickets/Create'; //新增优惠券
import TicketEdit from '../components/shop/tickets/Edit'; //新增优惠券
import Express from '../components/shop/expresses/Home';  //物流列表
//广告管理
import Advert from '../components/ad/adverts/Home'; //广告列表
import AdvertNode from '../components/ad/advert_nodes/Home';  //广告分类
//系统管理
import Config from '../components/system/configs/Home'; //系统设置

Vue.use(VueRouter);

const routes = [
   {path: '/', name: 'home', component: Home},
   {path: '/shop/products', name: 'products', component: Product},
   {path: '/shop/products/create', name: 'products_create', component: ProductCreate},
   {path: '/shop/products/edit/:id', name: 'products_edit', component: ProductEdit},
   {path: '/shop/categories', name: 'categories', component: Category},
   {path: '/shop/orders', name: 'orders', component: Order},
   {path: '/shop/orders/show/:id', name: 'orders_show', component: OrderShow},
   {path: '/shop/users', name: 'users', component: User},
   {path: '/shop/accounts', name: 'accounts', component: Account},
   {path: '/shop/tickets', name: 'tickets', component: Ticket},
   {path: '/shop/tickets/create', name: 'tickets_create', component: TicketCreate},
   {path: '/shop/tickets/edit/:id', name: 'tickets_edit', component: TicketEdit},
   {path: '/shop/expresses', name: 'expresses', component: Express},
   {path: '/ad/adverts', name: 'adverts', component: Advert},
   {path: '/ad/advert_nodes', name: 'advert_nodes', component: AdvertNode},
   {path: '/system/configs', name: 'configs', component: Config},
];


const router = new VueRouter({
   routes // (缩写) 相当于 routes: routes
});

export default router;